/*
 * bsp.h
 *
 * Copyright (C) 2011 - Dr.NP
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * @version bsp.h 1.0.0
 * @package libbspcore
 * @author Dr.NP <np@bsgroup.org>
 * @update 03/16/2011
 */

/**
 * Main header file of bspcore library
 *
 * === CHANGELOG ===
 * [03/16/2011] - Creation
 */

#ifndef BSP_H

#define BSP_H                                   1

#include "../config.h"

// Globals & return value
#define BSP_VERSION                             "BS.Play(Amanita)_build.20111206"

#undef BSP_TRUE
#define BSP_TRUE                                1

#undef BSP_FALSE
#define BSP_FALSE                               0

#define RTN_SUCCESS                             0
#define RTN_ERROR_FATAL                         -1
#define RTN_ERROR_GENERAL                       -2

#define RTN_ERROR_IO                            -1001
#define RTN_ERROR_IO_OPEN                       -1011
#define RTN_ERROR_IO_READ                       -1012
#define RTN_ERROR_IO_WRITE                      -1013
#define RTN_ERROR_IO_CLOSE                      -1014
#define RTN_ERROR_IO_DIR                        -1015
#define RTN_ERROR_IO_PIPE                       -1021
#define RTN_ERROR_IO_EVENT                      -1022
#define RTN_ERROR_IO_TIMER                      -1023
#define RTN_ERROR_IO_EPOLL                      -1101
#define RTN_ERROR_IO_EPOLL_CREATE               -1111
#define RTN_ERROR_IO_EPOLL_DISPATCH             -1112
#define RTN_ERROR_IO_EPOLL_CTL                  -1113

#define RTN_ERROR_MEMORY                        -2001
#define RTN_ERROR_MEMORY_ALLOC                  -2011
#define RTN_ERROR_MEMORY_FREE                   -2012
#define RTN_ERROR_MEMORY_READ                   -2013
#define RTN_ERROR_MEMORY_WRITE                  -2014
#define RTN_ERROR_MEMORY_OBJECT                 -2101

#define RTN_ERROR_SOCKET                        -3001
#define RTN_ERROR_SOCKET_CREATE                 -3011
#define RTN_ERROR_SOCKET_BIND                   -3012
#define RTN_ERROR_SOCKET_LISTEN                 -3013
#define RTN_ERROR_SOCKET_CONNECT                -3014
#define RTN_ERROR_SOCKET_ACCEPT                 -3015
#define RTN_ERROR_SOCKET_READ                   -3016
#define RTN_ERROR_SOCKET_WRITE                  -3017
#define RTN_ERROR_SOCKET_CLOSE                  -3018

#define RTN_ERROR_SCRIPT                        -4001
#define RTN_ERROR_SCRIPT_LOAD                   -4011
#define RTN_ERROR_SCRIPT_PARSE                  -4012
#define RTN_ERROR_SCRIPT_RUNTIME                -4013
#define RTN_ERROR_SCRIPT_STACK                  -4014

#define RTN_ERROR_MISC                          -5001
#define RTN_ERROR_RESOURCE_GET                  -5011
#define RTN_ERROR_RESOURCE_SET                  -5012
#define RTN_ERROR_SIGNAL                        -5111

#define RTN_ERROR_DB                            -6001
#define RTN_ERROR_DB_QUERY                      -6011
#define RTN_ERROR_DB_STORAGE                    -6012
#define RTN_ERROR_DB_CONNECTION                 -6013
#define RTN_ERROR_DB_UNKNOWN                    -6014
#define RTN_ERROR_DB_UNAVAILABLE                -6015
#define RTN_ERROR_DB_RESULT_FULL                -6016
#define RTN_ERROR_DB_INVALID_RESULT             -6017

// Definations
#define MAX_FILES                               204800
#define DEBUG_INFO                              1

// Core default value
#define DEFAULT_CONF_FILE                       "../etc/bsp.conf"
#define DEFAULT_SERVER_MODE                     "united"
#define SERVER_MODE_CENTER                      1
#define SERVER_MODE_NODE                        2
#define SERVER_MODE_UNITED                      0

#define DEFAULT_MYSQL_HOST                      "localhost"
#define DEFAULT_MYSQL_DB                        "bsp"
#define DEFAULT_MYSQL_USER                      "root"
#define DEFAULT_MYSQL_PASS                      ""

// Macros

// Structs

// Functions

#endif  /* bsp.h */
